home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…rary 5 (Internal Edition) / Apple R&P Lib Internal v5.0.iso / 6-Developer Demos / Developer Demos-Gen. / America Online Demo / Online Files / Online CCL / Online CCL.rsrc / AOcm_500_YoModem < prev    next >
Text File  |  1989-09-25  |  6KB  |  258 lines

  1. ! --------------------------------------------------------------------
  2. !   YO-YO MODEM.ALCL
  3. !   By: David Steinberg
  4. !  
  5. !   Date: June 20, 1989
  6. !   Changed 8/8/89 By DMC to match on "OK" after AT command
  7. !   Rev: 1.00
  8. !----------------------------------------------------------------------
  9. !
  10. ! Connect Sequence:
  11. !
  12. -LABEL 0
  13. Revision 5
  14. DsplyMsg Verifying Modem Setup
  15. CanBtn 30               { if cancel button - just exit }
  16. SetTries 0
  17. ChrDelay 2
  18. !
  19. !----------------------------------------------------------------------
  20. ! Check at 9600 Baud first.
  21. !
  22. -LABEL 1                { wake up the modem }
  23. Jump 11                 {Skip 9600 & 4800 for now}
  24. !
  25. SerReset 9600 0 8 1
  26. Pause 30
  27. ! DsplyMsg Sniff at 9600
  28. Flush
  29. !
  30. !                         
  31. MatchStr 1 2 OK
  32. MatchStr 2 2 NO         
  33. MatchStr 3 2 ERROR      
  34. MatchStr 4 2 >          { Special case for Avatex 1200 modems}
  35. !
  36. Xmit +++                { Get the modems attention}
  37. Wait 200                { Pause for 2 seconds, minimum gap required}
  38. !
  39. -Label 2
  40. !
  41. !Changed 8/8/89 by DMC top not look for 2 ok's
  42. MatchStr 1 5 OK
  43. MatchStr 2 6 NO         
  44. MatchStr 3 6 ERROR      
  45. MatchStr 4 6 >          { Special case for Avatex 1200 modems}
  46. MatchStr 5 3 AT
  47. !
  48. Pause 40                { Allow modem to settle between commands.}
  49. Xmit AT\13
  50. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  51. Jump 6                  { Try lower baud rate...time out error on modem.}
  52. !
  53. -Label 3
  54. MatchStr 1 5 OK
  55. Wait 200
  56. Jump 6
  57. !
  58. -Label 5
  59. !   DsplyMsg Successful Sniff at 9600
  60. Exit 9600
  61. !
  62. !----------------------------------------------------------------------
  63. !
  64. !----------------------------------------------------------------------
  65. ! Check at 4800 Baud.
  66. !
  67. -LABEL 6                { wake up the modem }
  68. SerReset 4800 0 8 1
  69. Pause 30
  70. !  DsplyMsg Sniff at 4800
  71. Flush
  72. !
  73. !                         
  74. MatchStr 1 7 OK
  75. MatchStr 2 7 NO         
  76. MatchStr 3 7 ERROR      
  77. MatchStr 4 7 >          { Special case for Avatex 1200 modems}
  78. !
  79. Xmit +++                { Get the modems attention}
  80. Wait 200                { Pause for 2 seconds, minimum gap required}
  81. !
  82. -Label 7
  83. !Changed 8/8/89 by DMC top not look for 2 ok's
  84. MatchStr 1 10 OK
  85. MatchStr 2 11 NO         
  86. MatchStr 3 11 ERROR      
  87. MatchStr 4 11 >         { Special case for Avatex 1200 modems}
  88. !Changed 8/8/89 by DMC top branch to 8 on finding AT
  89. MatchStr 5 8 AT
  90. !
  91. Pause 40                { Allow modem to settle between commands.}
  92. Xmit AT\13
  93. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  94. Jump 11                 { Try lower baud rate...time out error on modem.}
  95. !
  96. -Label 8
  97. MatchStr 1 10 OK
  98. Wait 200
  99. Jump 11
  100. !
  101. !
  102. -Label 10
  103. !   DsplyMsg Successful Sniff at 4800
  104. Exit 4800
  105. !
  106. !----------------------------------------------------------------------
  107. !
  108. !
  109. !----------------------------------------------------------------------
  110. ! Check at 2400 Baud.
  111. !
  112. -LABEL 11               { wake up the modem }
  113. SerReset 2400 0 8 1
  114. Pause 30
  115. !   DsplyMsg Sniff at 2400
  116. Flush
  117. !
  118. !                         
  119. MatchStr 1 12 OK
  120. MatchStr 2 12 NO         
  121. MatchStr 3 12 ERROR      
  122. MatchStr 4 12 >          { Special case for Avatex 1200 modems}
  123. !
  124. Xmit +++                { Get the modems attention}
  125. Wait 200                { Pause for 2 seconds, minimum gap required}
  126. !
  127. -Label 12
  128. MatchStr 1 13 AT
  129. MatchStr 2 16 NO         
  130. MatchStr 3 16 ERROR      
  131. MatchStr 4 16 >         { Special case for Avatex 1200 modems}
  132. ! Extra MatchStr for OK added... 
  133. ! If we get an ok at this point, all is well.
  134. MatchStr 5 15 OK
  135.  
  136. !
  137. Pause 40                { Allow modem to settle between commands.}
  138. Xmit AT\13
  139. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  140. Jump 16                 { Try lower baud rate...time out error on modem.}
  141. !
  142. -Label 13
  143. MatchStr 1 15 OK
  144. Wait 200
  145. Jump 16
  146. !
  147. !
  148. -Label 15
  149. !   DsplyMsg Successful Sniff at 2400
  150. Exit 2400
  151. !
  152. !----------------------------------------------------------------------
  153. !
  154. !
  155. !
  156. !----------------------------------------------------------------------
  157. ! Check at 1200 Baud.
  158. !
  159. -LABEL 16               { wake up the modem }
  160. SerReset 1200 0 8 1
  161. Pause 30
  162. !   DsplyMsg Sniff at 1200
  163. Flush
  164. !
  165. !                         
  166. MatchStr 1 17 OK
  167. MatchStr 2 17 NO         
  168. MatchStr 3 17 ERROR      
  169. MatchStr 4 17 >         { Special case for Avatex 1200 modems}
  170. !
  171. Xmit +++                { Get the modems attention}
  172. Wait 200                { Pause for 2 seconds, minimum gap required}
  173. !
  174. -Label 17
  175. MatchStr 1 18 AT
  176. MatchStr 2 21 NO         
  177. MatchStr 3 21 ERROR      
  178. MatchStr 4 21 >         { Special case for Avatex 1200 modems}
  179. MatchStr 5 20 OK        {Got the ok, successfull sniff at 1200}
  180. !
  181. Pause 40                { Allow modem to settle between commands.}
  182. Xmit AT\13
  183. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  184. Jump 21                 { Try lower baud rate...time out error on modem.}
  185. !
  186. -Lable 18
  187. MatchStr 1 20 OK
  188. Wait 200
  189. Jump 21
  190. !
  191. !
  192. -Label 20
  193. !    DsplyMsg Successful Sniff at 1200
  194. Exit 1200
  195. !
  196. !----------------------------------------------------------------------
  197. !
  198. !
  199. !----------------------------------------------------------------------
  200. ! Check at 300 Baud.
  201. !
  202. -LABEL 21                { wake up the modem }
  203. SerReset 300 0 8 1
  204. !    DsplyMsg Sniff at 300
  205. Pause 30
  206. Flush
  207. !
  208. !                         
  209. MatchStr 1 22 OK
  210. MatchStr 2 22 NO         
  211. MatchStr 3 22 ERROR      
  212. MatchStr 4 22 >          { Special case for Avatex 1200 modems}
  213. !
  214. Xmit +++                { Get the modems attention}
  215. Wait 200                { Pause for 2 seconds, minimum gap required}
  216. !
  217. -Label 22
  218. MatchStr 1 23 AT
  219. MatchStr 2 26 NO         
  220. MatchStr 3 26 ERROR      
  221. MatchStr 4 26 >         { Special case for Avatex 1200 modems}
  222. MatchStr 5 23 OK
  223. !
  224. Pause 40                { Allow modem to settle between commands.}
  225. Xmit AT\13
  226. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  227. Jump 26                 { Try lower baud rate...time out error on modem.}
  228. !
  229. -Label 23
  230. MatchStr 1 25 OK
  231. Wait 200
  232. Jump 26
  233. !
  234. !
  235. -Label 25
  236. !   DsplyMsg Successful Sniff at 300
  237. Exit 300
  238. !
  239. !----------------------------------------------------------------------
  240. !
  241. -Label 26         {generic}
  242. Talert Please take the following steps:\13\13 1) Turn your modem off; then back on.\13 2) Make sure that your modem and phone line are connected  correctly.\13 3) Try again.
  243. !
  244. -Label 27
  245. Alert 35 \13If the problem persists, call ~APPL customer service at ~ACUS.
  246. Exit -1
  247. !
  248. !
  249. !
  250. -Label 30         {User cancelled, just exit....}
  251. Exit -111
  252. !
  253. !
  254. *-Label 1
  255. *Exit 0
  256. !
  257. ###
  258.